﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Topics.Radical.Windows.Presentation.ComponentModel;
using Windows.UI.Core;

namespace SampleApp.Services
{
	class LaunchArgumentsHandler : ILaunchArgumentsHandler
	{
		readonly INavigationService navigation;
        readonly CoreDispatcher dispatcher;

		public LaunchArgumentsHandler( INavigationService navigation, CoreDispatcher dispatcher )
        {
            this.navigation = navigation;
            this.dispatcher = dispatcher;
        }

		public async Task OnLaunch( Windows.ApplicationModel.Activation.ILaunchActivatedEventArgs args )
		{
			if ( args.Arguments == "SampleApp-sample-context" ) 
			{
				await this.dispatcher.RunAsync( CoreDispatcherPriority.High, () =>
				{
					this.navigation.Navigate<Presentation.NotificationView>( args );
				} );
			}
		}
	}
}
